<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> 
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<jsp:useBean id="now" class="java.util.Date" /> 
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<link rel="stylesheet" type="text/css" href="<%=basePath%>/login/css/style.css" />
<style type="text/css">
th{
	color:#375B91;
}
</style>
<script type="text/javascript" src="<%=basePath %>/login/scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="<%=basePath %>/login/scripts/jquery.quickpaginate.js"></script>
<script type="text/javascript">
	function order(fieldname){
		$("#orderBy").val(fieldname);
		$("form:first").submit(); 
	}
	var flag=false;
	function outputExcel(){
		$("form:first").attr("action","zdzReportAction!outputExcel.action"); 
		$("form:first").submit(); 
		$("form:first").attr("action","zdzReportAction!reportRainhour.action"); 
	}
</script>
<div id="content2">
		<div id="box2">
			<div>
				<h3>
					当前位置&nbsp;:&nbsp;自动站数据监测&nbsp;>>&nbsp;历史数据查询&nbsp;>>&nbsp;区间风雨查询
				</h3>
			</div>
			<div id="search_bar2">
			<form action="zdzReportAction!reportRainhour.action" method="post" style="width:100%;">
			<table width="400" border="0" cellpadding="0" cellspacing="3">
					<tr>
						<td width="28">
							时间:
						</td>
						<td>
						<input size="15" name="startTime" onclick="SelectDate(this,'yyyy-MM-dd hh:00:00')" value="${startTime}" readonly="readonly"/>
						</td>
						<td>至</td>
						<td>
						<input size="15" name="endTime" onclick="SelectDate(this,'yyyy-MM-dd hh:00:00')" value="${endTime}" readonly="readonly"/>
						</td>
						<td>
						<input name="zdzType"  type="checkbox" value="镇区" <c:if test="${fn:contains(ztype,'镇区')}">checked="checked"</c:if>/>镇区
						<input name="zdzType"  type="checkbox" value="水库水闸" <c:if test="${fn:contains(ztype,'水库水闸')}">checked="checked"</c:if>/>水库水闸
						<input name="zdzType"  type="checkbox" value="学校" <c:if test="${fn:contains(ztype,'学校')}">checked="checked"</c:if>/>学校
						</td>
						<td>
							<input id="orderBy" type="hidden" name="orderByBean.orderByFile" value="${orderByBean.orderByFile}"/>
							<input type="hidden" name="orderByBean.orderByMethod" value="${orderByBean.orderByMethod}"/>
							<input type="submit" value="查询" />
							<input type ="button" value="最新" onclick="javascript:location.reload()"/>
							<input type="button" value="导出数据" onclick="javascript:outputExcel();"/>
						</td>
					</tr>
				</table>
				</form>
				<%--<c:if test="${admin.role==1}">
					<form method="post" action="zdzReportAction!outputExcel.action" style="width: 100%;">
							<table width="400" border="0" cellpadding="0" cellspacing="3">
								<tr>
									<td width="28">日期:</td>
									<td><input id="out_date" size="15" name="date" value="" readonly="readonly" onfocus="calendar()"/></td>
									<td width="40">时间段:</td>
									<td>
										<select name="timestage" id="out_timestage">
											<option value="08">昨天8时-今天8时</option>
											<option value="20">昨天20时-今天20时</option>
										</select>
									</td>
									<td width="60">排序对象:</td>
									<td>
										<select name="orderfield" id="out_orderfield">
											<option value="dayrf">雨量</option>
											<option value="wd10maxdf">最大风速</option>
											<option value="wd3smaxdf">极大风速</option>
										</select>
									</td>
									<td width="60">排序方式:</td>
									<td>
										<select name="ordertype" id="out_ordertype">
											<option value="desc">降序</option>
											<option value="asc">升序</option>
										</select>
									</td>
									<td>								
									<input type="submit" value="导出数据" />
								</td>
								</tr>
							</table>
						</form>
					</c:if>--%>
	    </div>
	    <div style="color: blue;font-weight: bold;font-size: 18px;">${reportTitle }</div>
	    
			<table id="dataTable">
				<thead>
					<tr>
						<th colspan="2">自动站点</th>
						<th rowspan="2"><a href="javascript:order('dayrf')" class="order">累积雨量</a></th>
						<th rowspan="2"><a href="javascript:order('hourrf')" class="order">最强时雨量</a></th>
						<th rowspan="2">最强时雨量出现时间</th>
						<th rowspan="2"><a href="javascript:order('wd10maxdf')" class="order">最大风速最大值</a></th>
						<th rowspan="2">风级</th>
						<th rowspan="2">最大风速最大值出现时间</th>
						<th rowspan="2"><a href="javascript:order('wd3smaxdf')" class="order">极大风速最大值</a></th>
						<th rowspan="2">风级</th>
						<th rowspan="2">极大风速最大值出现时间</th>
					</tr>
					<tr>
						<th><a href="javascript:order('id')" class="order">代号</a></th>
						<th>站名</th>
					</tr>
				</thead>
				<tbody>
				<tr><td colspan="17" align="center"><c:if test="${empty zdzList}">暂无数据</c:if></td></tr>
				<c:forEach items="${zdzList}" var="report">
					<tr>
						<td class="a-center">${report.id}</td>
						<td class="a-center">${report.zdzName }</td>
						<td class="a-center">${report.dayrf }</td>
						<td class="a-center">${report.hourrf }</td>
						<td class="a-center"><fmt:formatDate value="${report.zdzdatetime}" pattern="yyyy-MM-dd HH:mm"/></td>
						<td class="a-center">${report.wd10maxdf }</td>
						<td class="a-center">${report.wd10WindLevel }</td>
						<td class="a-center"><fmt:formatDate value="${report.wd10maxtime}" pattern="yyyy-MM-dd HH:mm"/></td>
						<td class="a-center">${report.wd3smaxdf }</td>
						<td class="a-center">${report.wd3WindLevel }</td>
						<td class="a-center"><fmt:formatDate value="${report.wd3smaxtime}" pattern="yyyy-MM-dd HH:mm"/></td>
					</tr>
				</c:forEach>
				</tbody>
			</table>
			<div id="temp" style="height: 30px;padding-left:500px;"></div>
			</div>
		<br />
	</div>

